
'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const ObjectId = Schema.ObjectId;

  const NoticeSchema = new Schema({
    title: { type: String },
    desc: { type: String },
    content: { type: String },
    user_id: { type: ObjectId },
    deleted: { type: Boolean, default: false },
    create_at: { type: Date, default: Date.now },
  });

  return mongoose.model('Notice', NoticeSchema);
};
